package com.pandora.tv.Adapter;

import java.util.ArrayList;

import android.widget.BaseAdapter;

import com.pandora.tv.Info.ApplicationInfo;

public abstract class ApplicationAdapter extends BaseAdapter implements NotifyInterface {
	
	private static ArrayList<ApplicationInfo> mInfoList = new ArrayList<ApplicationInfo>();
	private static ArrayList<ApplicationAdapter> mListener = new ArrayList<ApplicationAdapter>();
		
	protected void setListener(ApplicationAdapter noti) {
		mListener.add(noti);
	}
	
	protected void notiChangeData() {
		for (ApplicationAdapter noti : mListener) {
			noti.notifyDataSetChanged();
		}
		
	}
	
	protected ArrayList<ApplicationInfo> getAppList() {
		return mInfoList;
	}
	
	protected void addAppInfo(ApplicationInfo info) {
		mInfoList.add(info);
	}
	
	protected void removeAppInfo(ApplicationInfo info) {
		mInfoList.remove(info);
	}
	
	protected void allClear() {
		mInfoList.clear();
		mListener.clear();
	}
}
